<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>css的背景定位属性讲解</title>
    <style type="text/css">
        .bg{
            width: 500px;
            height: 500px;
            border: 2px solid green;
            background-color: gray;
            background-image: url(../images/scholl_flower.jpeg);
            /* 平铺方式 */
            background-repeat: no-repeat;
            /* 背景定位 */
            /* background-position: 50px 100px; */
            /* background-position-x: 100px;
            background-position-y: 100px; */
            /* top right bottom left center */
            /* background-position: right top; */
            /* 百分比:0% 50% 100% */
            /* 水平百分比的值=容器宽度的百分比-背景图片的百分比 */
            background-position: 30% 50%;
        }
    </style>
</head>
<body>
    <div class="bg">

    </div>
</body>
</html>